package com.sqgxy.controller;

import com.sqgxy.vo.SchoolInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class SchoolController {
    @Value("${school.name}")
    private String name;
    @Value("${school.address}")
    private String address;

    @Resource
    private SchoolInfo info;

    @RequestMapping("/data")
    @ResponseBody
    public String queryData(){
            return name+",address="+address;
    }
    @RequestMapping("/info")
    @ResponseBody
    public String queryInfo(){
        return "SchoolInfo对象=="+info.toString();
    }
}
